<h:form id="formPrevisaoFinanceira" 
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:pe="http://primefaces.org/ui/extensions"
        xmlns:p="http://primefaces.org/ui" 
        xmlns:f="http://java.sun.com/jsf/core">

    <script language="JavaScript" src = "scripts/script.js"/>

    <h:panelGrid columns="1">

        <h:panelGrid columns="2" >

            <h:panelGroup>

                <h:outputLabel value="Fonte de Recurso*"/><br/>
                <p:selectOneMenu id="cbxFontesDeRecursos" 
                                 value="#{previsaoFinanceiraBean.previsaoFinanceira.fonteDeRecurso}"
                                 required="true" 
                                 requiredMessage="O campo fonte de recurso é requerido"
                                 filter="true" 
                                 filterMatchMode="startsWith" 
                                 style="width: 518px">
                    
                    <f:selectItem itemLabel="Selecione" />
                    <f:selectItems value="#{previsaoFinanceiraBean.fontesDeRecursos}" />
                    <f:converter converterId="simpleEntityConverter" />
                    
                </p:selectOneMenu>

            </h:panelGroup>
            
        </h:panelGrid>

        <h:panelGrid columns="4" 
                     >

            <h:panelGroup style="width: 100%">
                <h:outputLabel value="1°ano*"/><br/>
                <pe:inputNumber styleClass="up" 
                                value="#{previsaoFinanceiraBean.previsaoFinanceira.ano1}" 
                                required="true" requiredMessage="O campo ano1 é requerido" 
                                symbol="R$" 
                                decimalSeparator="," 
                                thousandSeparator="." 
                                style="width: 90%" />
            </h:panelGroup>

            <h:panelGroup style="width: 100%">
                <h:outputLabel value="2° ano*"/><br/>
                <pe:inputNumber styleClass="up" 
                                value="#{previsaoFinanceiraBean.previsaoFinanceira.ano2}" 
                                required="true"
                                requiredMessage="O campo ano2 é requerido"
                                symbol="R$" 
                                decimalSeparator="," 
                                thousandSeparator="." 
                                style="width: 90%"/>
            </h:panelGroup>

            <h:panelGroup style="width: 100%">
                <h:outputLabel value="3° ano*"/><br/>
                <pe:inputNumber styleClass="up" 
                                value="#{previsaoFinanceiraBean.previsaoFinanceira.ano3}" 
                                required="true"
                                requiredMessage="O campo ano3 é requerido" 
                                symbol="R$" 
                                decimalSeparator="," 
                                thousandSeparator="." 
                                style="width: 90%"/>
            </h:panelGroup>

            <h:panelGroup style="width: 100%">
                <h:outputLabel value="4° ano*"/><br/>
                <pe:inputNumber styleClass="up" 
                                value="#{previsaoFinanceiraBean.previsaoFinanceira.ano4}" 
                                required="true"
                                requiredMessage="O campo ano4 é; requerido" 
                                symbol="R$" 
                                decimalSeparator="," 
                                thousandSeparator="." 
                                style="width: 90%"/>
            </h:panelGroup>

        </h:panelGrid>

    </h:panelGrid>

    <hr/>

    <p:commandButton id="btnGravar" value="Gravar" 
                     actionListener="#{previsaoFinanceiraBean.adicionarEditarFim}"
                     update="formPrevisaoFinanceira" />

    <p:commandButton value="Cancelar" 
                     actionListener="#{previsaoFinanceiraBean.cancelar}"
                     immediate="true"/>

</h:form>


